package com.sunday.common.netty.e5_Udp.client;


import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.DatagramChannel;
import io.netty.handler.codec.DatagramPacketDecoder;
import io.netty.handler.codec.string.StringDecoder;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class UdpClientChannel extends ChannelInitializer<DatagramChannel> {


    @Override
    protected void initChannel(DatagramChannel ch) throws Exception {
        ch.pipeline()
                .addLast(new DatagramPacketDecoder(new StringDecoder()))
                .addLast(new UdpClientHandler());
    }
}
